const Controller = require('egg').Controller;

class buyBook extends Controller {
    /*书籍购买*/
    async bookDetail() {
        var id = this.ctx.params.id;
        const detail = await this.ctx.service.buyBook.bookDetail(id);
        detail.covers =  detail.covers.split(' ');
        await this.ctx.render('page/other/buyBook.html',{data:detail});
    }
    async bookList() {
        const data = await this.ctx.service.buyBook.bookList();
        const memberList = await this.ctx.service.banner.bannerList('vip_area');
        const res = {
            memberList:memberList,
            data:data,
        }
        await this.ctx.render('page/other/book.html',{data:res});
    }

}

module.exports = buyBook;